package com.crud.util;
/*字符串去除空格*/
public class StringRemoveSpacesUtil {
    public static String removeSpaces(String string){
        int j = 0;
        char[] chars = string.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            if (chars[i]!=' '){
                if (chars[j]==' '){
                    chars[j]=chars[i];
                    chars[i]=' ';
                }
                j++;
            }
        }
        string = String.valueOf(chars);
        return string;
    }
}
